1. Field of the Invention
This invention relates to a variable-length coding method and an apparatus thereof. More particularly, the present invention relates to a method for transforming fixed length code words into variable-length code words on the basis of Huffman code tree and an apparatus which can perform the method.
2. Description of the Prior Art
Generally, a variable-length coding method is a coding technique often used for compressing data without loss of data. The variable-length coding transforms all occurring possible data, which are generated from a data source and are represented into fixed-length code words, into variable-length code words according to occurring probability of the data, such that an average code length of the data is reduced. That is, by assigning variable-length code words to the library of all occurring possible cod words, the average word length of the variable-length code is shorter than that of the original data, and therefore, data compression is achieved.
Huffman coding method is a procedure commonly used to construct a minimum redundant variable-length code for a known data statistic. Huffman coding method applies data of which statistics have already been known to Huffman code tree according to the statistic, and therefore the variable-length codes according to Huffman coding method are prefix-free variable length codes.
One example of a variable-length coding apparatus is disclosed in U.S. Pat. No. 3,675,212 issued to Josef Raviv, etc. on Jul. 4, 1972. The variable-length coding apparatus suggested by Josef Raviv, etc. includes a three-state associative memory which is employed as an encoding-decoding instrumentality for making conversions between fixed-length codes and variable-length codes. The three-state associative memory stores lengths of the variable-length code words associated with the fixed-length codes and variable-length codes.
Furthermore, the present inventor and assignee filed a decoding apparatus dated May 31, 1996, under the application Ser. No. 08/655,838, which is now issued.